package org.ttitfly.ttcore.entity.system;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.ttitfly.ttcore.entity.IdEntity;

/**
 * 用户.
 * 
 * 使用JPA annotation定义ORM关系. 使用Hibernate annotation定义JPA 1.0未覆盖的部分.
 * 
 * @author mhb
 */
@Entity
// 表名与类名不相同时重新定义表名.
@Table(name = "s_dictionary")
// 默认的缓存策略.
// @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Dictionary extends IdEntity {
	

	//名称
	@Column(name = "title")
	private String title;
	
	//英文名称
	@Column(name = "keyword")
	private String keyword;
	
	//父类ID,0代表顶级
	@Column(name = "parent_id")
	private Long parentId = new Long(0);
	
	//是否是叶子节点
	@Column(name = "leaf")
	private Integer leaf;
	
	//排序
	@Column(name = "order_num")
	private Integer orderNum;
	

	public String getKeyword() {
		return keyword;
	}


	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}


	public Long getParentId() {
		return parentId;
	}


	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}


	

	public String getTitle() {
		return title;
	}


	public void setTitle(String title) {
		this.title = title;
	}



	public Integer getLeaf() {
		return leaf;
	}


	public void setLeaf(Integer leaf) {
		this.leaf = leaf;
	}


	public Integer getOrderNum() {
		return orderNum;
	}


	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}


	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}